package com.hdax.cart.config;


import com.hdax.cart.interceptor.CartInterceptor;
import com.hdax.cart.vo.Cart;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class GuLiMallWebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        //参数为拦截的请求 ,当前拦截的是购物车的所有请求
        registry.addInterceptor(new CartInterceptor()).addPathPatterns("/**");
    }
}
